package game
{
	import away3d.containers.*;
	
	import engine.asset.*;
	import engine.core.*;
	import engine.graphics.*;
	import engine.graphics.lighting.*;
	import engine.graphics.shader.*;
	import engine.graphics.vfx.*;
	import engine.loaders.*;
	import engine.profile.*;
	import engine.sound.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.net.*;
	import flash.utils.*;
	
	import game.actor.*;
	import game.asset.*;
	import game.core.*;
	import game.graphics.*;
	import game.graphics.away3d.*;
	import game.localization.*;
	import game.messages.gamedata.*;
	import game.messages.inventory.*;
	import game.messages.login.*;
	import game.messages.progression.*;
	import game.network.*;
	import game.scene.*;
	import game.sound.*;
	import game.store.*;
	import game.telemetry.*;
	import game.tools.*;
	import game.ui.controls.*;
	import game.ui.core.*;
	import game.ui.hud.*;
	
	public class RxMaster
	{
		private static var s_stage:Stage;
		private static var s_view:View3D;
		private static var s_camera:RxGameCamera;
		private static var s_mapName:String;
		private static var s_mapAssetGroup:RxAssetGroup;
		private static var s_questing:int = 0;
		private static var s_loginStatusDialog:RxTextField;
		private static var s_profilerState:RxProfilerState;
		private static var s_samplingProfiler:RxSamplingProfiler;
		private static var s_frameDualProfiler:RxDualProfiler;
		private static var s_accumDualProfiler:RxDualProfiler;
		private static var s_version:String = "LOCAL";
		private static var s_vfxLoaded:Boolean;
		private static var s_musicLoaded:Boolean;
		private static var s_staticManifestFile:String;
		private static var s_staticAssetsPath:String;
		private static var s_loginTimer:Timer;
		public static const s_sharedObjectName:String = "kr_options";
		private static var s_loginAlert:Boolean = false;
		private static var s_heroic:Boolean;
		
		public function RxMaster()
		{
		}
		
		public static function GetBuildVersion() : String
		{
			return s_version;
		}
		
		public static function GetMapName() : String
		{
			return s_mapName;
		}
		
		public static function Initialize(param1:Stage, param2:View3D, param3:RxGameCamera) : void
		{
			s_stage = param1;
			s_view = param2;
			s_camera = param3;
			LoadLocalSettings();
		}
		
		private static function LoadLocalSettings() : void
		{
			var _loc_1:* = SharedObject.getLocal(s_sharedObjectName);
			var _loc_2:* = _loc_1.data;
			RxSoundSuite.SetSoundEnabled(!_loc_1.data.hasOwnProperty("soundEnabled") || _loc_1.data.soundEnabled);
			RxMusicManager.SetMusicEnabled(!_loc_1.data.hasOwnProperty("musicEnabled") || _loc_1.data.musicEnabled);
		}
		
		public static function SetProfilerState(param1:RxProfilerState) : void
		{
			s_profilerState = param1;
			s_samplingProfiler = s_profilerState.GetSamplingProfiler();
			s_frameDualProfiler = s_profilerState.GetFrameDualProfiler();
			s_accumDualProfiler = s_profilerState.GetAccumDualProfiler();
		}
		
		public static function BootGame() : void
		{
			RxPerformanceTelemetry.SetMode(RxPerformanceTelemetry.MODE_BOOT);
			RxManifest.Load(OnManifestLoaded);
		}
		
		public static function OnManifestLoaded() : void
		{
			RxUI.ShowLoadingScreen();
			RxTransactionServer.instance.SetLoginStatusChangedCallback(OnLoginStatusChanged);
			RxEntity.EnablePhase(RxEntityPhase.ENTITY_PHASE_NAV);
			RxEntity.EnablePhase(RxEntityPhase.ENTITY_PHASE_HERO);
			RxEntity.EnablePhase(RxEntityPhase.ENTITY_PHASE_CAMERA);
			RxEntity.EnablePhase(RxEntityPhase.ENTITY_PHASE_NPC);
			RxEntity.EnablePhase(RxEntityPhase.ENTITY_PHASE_SCENE);
			RxEntity.EnablePhase(RxEntityPhase.ENTITY_PHASE_HUD);
			RxEntity.EnablePhase(RxEntityPhase.ENTITY_PHASE_POSTHUD);
			RxEntity.EnablePhase(RxEntityPhase.ENTITY_PHASE_FINAL);
			var _local1:XML = 	<assetGroup>
									<xml url="clientvars.xml"/>
									<csv name="levels" url="levels.csv"/>
								</assetGroup>;
			var group:RxAssetGroup = new RxAssetGroup();
			group.Init(_local1, null);
			var assetXML:RxAssetXML = new RxAssetXML();
			assetXML.SetURL("version.xml");
			assetXML.SuppressIOError();
			group.AddAsset(assetXML);
			group.AddAsset(RxLocalizationManager.GetLocaleAssetLoader("en_us") as RxAsset);
			group.AddAsset(RxUICursor.GetAssetLoaderForCursors() as RxAsset);
			s_accumDualProfiler.Start("boot assets");
			group.AddCallback(new RxAssetCallback(OnBootAssetsLoaded));
			group.Load();
		}
		
		private static function OnLoginStatusChanged(_arg1:int, _arg2:uint, _arg3:String) : void
		{
			var _local5:String;
			var _local6:String;
			var _local4:String = "System Error";
			var _local7:Boolean;
			switch (_arg1)
			{
				case RxLogin_ConnectStatusMessage.STATUS_LOGIN_FAILED_INCOMPATIBLE_VERSION:
					_local5 = "Your client seems to be out of date.  Please update and relaunch.";
					_local6 = "ui/portraits/system_message_network_down.png";
					break;
				case RxTransactionServer.STATUS_LOGOUT_DISCONNECTED:
					_local5 = "The connection to the game server was lost.  Please refresh the browser.";
					_local6 = "ui/portraits/system_message_network_down.png";
					break;
				case RxLogin_LoginStatusMessage.STATUS_LOGIN_FAILED_GENERAL_ERROR:
					_local5 = "A general error occured on the server while attempting to log in. Refresh the browser to try again.";
					_local6 = "ui/portraits/system_message_technical_difficulties.png";
					break;
				case RxLogin_LoginStatusMessage.STATUS_LOGIN_FAILED_CONNECTED_ELSEWHERE:
					_local5 = "This user logged in from a different location.";
					_local6 = "ui/portraits/system_message_technical_difficulties.png";
					break;
				case RxLogin_LoginStatusMessage.STATUS_LOGIN_FAILED_SERVICE_UNAVAILABLE:
					_local5 = "The game is temporarily unavailable. Please try again later.";
					_local6 = "ui/portraits/system_message_network_down.png";
					break;
				case RxLogin_LoginStatusMessage.STATUS_LOGIN_FAILED_USER_MAINTENANCE:
					_local5 = "This user is undergoing maintenance and is temporarily unavailable. Please try again later.";
					_local6 = "ui/portraits/system_message_were_working_on_it.png";
					break;
				case RxLogin_LoginStatusMessage.STATUS_LOGIN_FAILED_SOFTWARE_RENDERING:
					_local4 = "Check Graphics Settings";
					_local5 = "We were unable to initialize hardware graphics acceleration.  Please check your Flash 11 settings or visit <font color='#0000FF'><a href='http://rumblegam.es/IOm0Tl'>http://rumblegam.es/IOm0Tl</a></font> for technical support.";
					_local6 = "ui/portraits/system_message_technical_difficulties.png";
					break;
				case RxLogin_LoginStatusMessage.STATUS_LOGIN_SUCCEEDED:
					StopLoginTimer();
					if ((_arg2 & RxLogin_LoginStatusMessage.FLAG_FAKE_LOGIN))
					{
						_local5 = "There was a problem communicating with the platform.  You have been logged in with a temporary account.";
						_local6 = "ui/portraits/system_message_sorry.png";
						_local7 = true;
					}
					break;
			}
			
			if (_local5 != null)
			{
				ShowLoginErrorAlert(_local4, _local5, _local6, _local7);
			}
			
			if (_arg1 != RxLogin_LoginStatusMessage.STATUS_LOGIN_SUCCEEDED)
			{
				RxTransactionServer.instance.Disconnect();
			}
		}
		
		private static function StopLoginTimer() : void
		{
			if (s_loginTimer != null)
			{
				s_loginTimer.stop();
				s_loginTimer.removeEventListener(TimerEvent.TIMER, OnLoginTimeout);
				s_loginTimer = null;
			}
		}
		
		private static function OnLoginTimeout(event:TimerEvent) : void
		{
			StopLoginTimer();
			RxTransactionServer.instance.Disconnect();
			ShowLoginErrorAlert("System Error", "Login request timed out.  Please refresh the browser.", "ui/portraits/system_message_network_down.png");

		}
		
		public static function ShowLoginErrorAlert(param1:String, param2:String, param3:String, param4:Boolean = false) : void
		{
			var _loc_5:Array = null;
			if (s_loginAlert)
			{
				return;
			}
			RxLog.Warning("login alert: " + param2);
			if (param4)
			{
				_loc_5 = ["OK"];
			}
			else
			{
				_loc_5 = ["Refresh"];
			}
			s_loginAlert = true;
			var _loc_6:* = RxDialogManager.instance.ShowAlert(param1, param2, _loc_5, (_loc_5.length - 1), param3, null, false, true, true);
			RxDialogManager.instance.ShowAlert(param1, param2, _loc_5, (_loc_5.length - 1), param3, null, false, true, true).SetMinHeight(350);
			_loc_6.SetCallback(OnLoginErrorAlertClosed);
		}
		
		private static function OnLoginErrorAlertClosed(param1:RxAlert, param2:String) : void
		{
			s_loginAlert = false;
			if (param2 == "Refresh")
			{
				RxExternalInterface.RefreshBrowser();
			}
		}
		
		private static function OnBootAssetsLoaded(param1:RxAssetCallback) : void
		{
			var _loc_12:RxUIElement = null;
			RxContext.SetGlobal("masterState", "OnBootAssetsLoaded");
			RxMain.instance.OnLoadProgress();
			RxUICursor.Initialize();
			var _loc_2:* = RxAssetXML.GetByURL("version.xml");
			var _loc_3:* = _loc_2.GetXML();
			if (_loc_3)
			{
				s_version = _loc_3.name.text();
			}
			RxClientVars.Parse("clientvars.xml");
			RxClientVars.Parse("uservar.xml");
			//RxSoundChannel.SetGlobalVolume(RxClientVars.GetNumber("masterVolume"));
			var _loc_4:RxRenderer = RxRenderer(s_view.renderer);
			var _loc_5:SharedObject = RxLocalSettings.GetObject();
			if (RxLocalSettings.GetObject())
			{
				if (_loc_4.IsSoftwareMode())
				{
					delete _loc_5.data.gpuPerfScore;
					delete _loc_5.data.graphicsQuality;
				}
				else
				{
					if (_loc_5.data.gpuPerfScore == 0)
					{
						delete _loc_5.data.gpuPerfScore;
						delete _loc_5.data.graphicsQuality;
					}
					delete _loc_5.data.allowSoftwareMode;
				}
				if (!_loc_5.data.hasOwnProperty("gpuPerfScore"))
				{
					_loc_4.GPUPerfTest();
					_loc_5.data.gpuPerfScore = _loc_4.GetGPUPerfScore();
					RxLog.Info("GPU perf score: " + _loc_5.data.gpuPerfScore.toFixed(1) + " in " + _loc_4.GetGPUPerfTime().toFixed(1) + " secs");
				}
				else
				{
					_loc_4.SetGPUPerfScore(_loc_5.data.gpuPerfScore);
					RxLog.Info("GPU perf score: " + _loc_5.data.gpuPerfScore.toFixed(1));
				}
				if (!_loc_5.data.hasOwnProperty("cpuPerfScore"))
				{
					_loc_4.CPUPerfTest();
					_loc_5.data.cpuPerfScore = _loc_4.GetCPUPerfScore();
					RxLog.Info("CPU perf score: " + _loc_5.data.cpuPerfScore.toFixed(1) + " in " + _loc_4.GetCPUPerfTime().toFixed(1) + " secs");
				}
				else
				{
					_loc_4.SetCPUPerfScore(_loc_5.data.cpuPerfScore);
					RxLog.Info("CPU perf score: " + _loc_5.data.cpuPerfScore.toFixed(1));
				}
				if (!_loc_5.data.hasOwnProperty("graphicsQuality"))
				{
					_loc_5.data.graphicsQuality = _loc_4.SetGraphicsQualityAuto();
				}
				else
				{
					_loc_4.SetGraphicsQuality(_loc_5.data.graphicsQuality);
				} 
				RxLog.Info("Graphics quality: " + _loc_5.data.graphicsQuality);
			}
			RxLocalSettings.WriteSettings();
			var _loc_6:* = RxClientVars.GetNumber("immunityRefractionScale");
			//_loc_4.SetShaderRefractionScale(_loc_6);
			var _loc_7:* = RxClientVars.GetNumber("xrayRed");
			var _loc_8:* = RxClientVars.GetNumber("xrayGreen");
			var _loc_9:* = RxClientVars.GetNumber("xrayBlue");
			var _loc_10:* = RxClientVars.GetNumber("xrayEmissive");
			var _loc_11:* = RxClientVars.GetNumber("xrayBias");
			//_loc_4.SetShaderXrayColorRGBA(_loc_7, _loc_8, _loc_9, _loc_10);
			//_loc_4.SetShaderXrayBias(_loc_11);
			SetMapName(RxClientVars.GetString("bootMap"));
			if (s_mapName == null || s_mapName == "" || s_mapName == RxProgression_Constants.s_defaultMapName)
			{
				SetMapName(RxProgression_Constants.s_defaultMapName);
				RxSimulation.BeginLoading(null, true);
				RxSimulation.WaitMapSelected(OnLevelSelect);
			}
			else
			{
				if (s_mapName == "selectable")
				{
					_loc_12 = new RxLevelSelect(s_stage, OnLevelSelectDialogClosed);
					RxUI.AddElementToLayer(_loc_12, RxUILayerConstants.TOP);
				}
				RxSimulation.BeginLoading(OnLoadCompleteCallback, true);
			}
			s_accumDualProfiler.End();
			RxUtilities.ForceGarbageCollection();
			
			// changed for jobin
			// login 超时设置为3000
			s_loginTimer = new Timer(3000 * 1000);
			s_loginTimer.addEventListener(TimerEvent.TIMER, OnLoginTimeout);
			s_loginTimer.start();
		}
		
		public static function SetMapName(param1:String) : void
		{
			s_mapName = param1;
			if (param1 != null && param1.search(param1) != -1)
			{
				s_heroic = true;
			}
			else
			{
				s_heroic = false;
			}
		}
		
		private static function OnLevelSelectDialogClosed(param1:String) : void
		{
			s_mapName = param1;
			if (RxTransactionServer.instance.IsLoggedIn())
			{
				OnLevelSelect(param1);
			}
			else
			{
				RxUI.ShowLoadingScreen();
			}
		}
		
		private static function OnLoadCompleteCallback() : void
		{
			if (RxTransactionServer.instance.IsLoggedIn())
			{
				if (s_mapName != "selectable")
				{
					OnLevelSelect(s_mapName);
				}
			}
		}
		
		private static function OnLevelSelect(_arg1:String) : void
		{
			s_accumDualProfiler.Start("level select");
			if (s_mapName != RxProgression_Constants.s_defaultMapName)
			{
				RxSimulation.SendMapSelected(_arg1);
			}
			
			s_mapName = _arg1;
			RxUI.ShowLoadingScreen();
			RxMusicManager.Initialize();
			RxGameData.instance.CreateTable(RxGameData_NameSpace.ITEM);
			RxGameData.instance.Request(RxGameData_NameSpace.ITEM, RxInventory_ItemNameConstants.ITEMNAME_GOLD, null, null);
			RxGameData.instance.CreateTable(RxGameData_NameSpace.QUEST);
			var _local2:XML = <assetGroup>
				<csv name="health" url="health.csv"/>
				<csv name="experience" url="experience.csv"/>
				<csv name="energy" url="energy.csv"/>
				<csv name="abilities" url="abilities.csv"/>
				<csv name="abilityset" url="abilityset.csv"/>
				<csv name="abilityswitch" url="abilityswitch.csv"/>
				<csv name="questrewards" url="questrewards.csv"/>
				<csv name="questtext" url="questtext.csv"/>
				<csv name="skills" url="skills.csv"/>
				<csv name="itemquality" url="itemquality.csv"/>
				<xml name="state" url="state.xml"/>
				<csv name="character" url="character.csv"/>
				<csv name="spawner" url="spawner.csv"/>
				<csv name="soundsuite" url="soundsuite.csv"/>
				<csv name="itemattributes" url="itemattributes.csv"/>
				<csv name="storeaisles" url="storeaisles.csv"/>
				<xml name="sequences" url="sequences.xml"/>
				<xml name="animations" url="animations.xml"/>
				<xml name="partstable" url="parts_table.xml"/>
				<csv name="tutorials" url="tutorials/tutorials.csv"/>
			</assetGroup>;
			var _local3:RxAssetGroup = new RxAssetGroup();
			_local3.Init(_local2, null);
			_local3.AddAsset(RxUI.GetAssetPreloader());
			s_accumDualProfiler.Start("global assets");
			_local3.AddCallback(new RxAssetCallback(OnGlobalAssetsLoaded));
			_local3.Load();
		}
		
		private static function OnGlobalAssetsLoaded(param1:RxAssetCallback) : void
		{
			var _loc_2:* = RxAssetXML.GetByURL("animations.xml");
			RxAnimLabels.ParseAnimationTable(_loc_2.GetXML());
			var _loc_3:* = RxAssetXML.GetByURL("parts_table.xml");
			RxCharacter.ParsePartsTable(_loc_3.GetXML());
			var _loc_4:* = RxRenderer(s_view.renderer);
			var _loc_5:* = RxRenderer(s_view.renderer).GetShaderFamilyManager();
			RxCharacter.GetPartsTable().SetShaderFamily(_loc_5.GetShaderFamily("character"));
			s_accumDualProfiler.End();
			RxUtilities.ForceGarbageCollection();
			s_accumDualProfiler.Start("loadassets.xml");
			var _loc_6:* = new RxAssetGroup();
			new RxAssetGroup().SetURL("loadassets.xml");
			_loc_6.AddCallback(new RxAssetCallback(StartMapLoad));
			_loc_6.SetUsedByGPU(true);
			_loc_6.Load();
		}
		
		private static function StartMapLoad(param1:RxAssetCallback) : void
		{
			RxPerformanceTelemetry.SetMode(RxPerformanceTelemetry.MODE_LOADING_MAP);
			s_accumDualProfiler.End();
			RxUtilities.ForceGarbageCollection();
			s_accumDualProfiler.Start("mapassets.xml");
			RxLog.Info("loading map: " + s_mapName);
			s_mapAssetGroup = new RxAssetGroup();
			s_mapAssetGroup.SetURL("maps/" + s_mapName + "/mapassets.xml");
			s_mapAssetGroup.AddCallback(new RxAssetCallback(OnMapAssetsLoaded));
			s_mapAssetGroup.SetUsedByGPU(true);
			s_mapAssetGroup.Load();
			var _loc_2:* = "<assetGroup><csv name=\"levelspawner\" url=\"spawner_" + s_mapName + ".csv\"/></assetGroup>";
			var _loc_3:* = new XML(_loc_2);
			var _loc_4:* = new RxAssetGroup();
			new RxAssetGroup().Init(_loc_3, null);
			_loc_4.SuppressIOError();
			_loc_4.Load();
		}
		
		private static function OnMapAssetsLoaded(param1:RxAssetCallback) : void
		{
			var _loc_10:XML = null;
			var _loc_11:RxAssetCSV = null;
			var _loc_12:RxCubeTexture = null;
			var _loc_13:XML = null;
			var _loc_14:XMLList = null;
			var _loc_15:String = null;
			var _loc_16:RxAssetVFX = null;
			var _loc_2:* = RxAssetCSV.GetByName("spawner");
			var _loc_3:* = RxAssetCSV.GetByName("levelspawner");
			if (_loc_3 != null && _loc_3.rows > 0)
			{
				_loc_2.Delete();
				_loc_3.Rename("spawner");
			}
			var _loc_4:* = RxAssetMapInfo.GetByName("mapinfo");
			s_camera.ParseFromXML(_loc_4.GetCameraXMLList());
			var _loc_5:* = RxRenderer(s_view.renderer);
			var _loc_6:* = RxRenderer(s_view.renderer).GetSunLight();
			RxRenderer(s_view.renderer).GetSunLight().ParseFromXML(_loc_4.GetSunlightXMLList());
			var _loc_7:* = new RxGigaTextureInfo();
			new RxGigaTextureInfo().ParseFromXML(_loc_4.GetURL(), _loc_4.GetSlicesXMLList());
			_loc_5.SetGigaTexture(_loc_7);
			var _loc_8:* = RxAssetScene.GetByName("scene");
			if (RxAssetScene.GetByName("scene") != null)
			{
				_loc_5.SetScene(_loc_8);
				_loc_12 = _loc_8.GetCubemap("envmap");
				if (_loc_12 != null)
				{
					_loc_5.SetEnvironmentCubeTexture(_loc_12);
				}
				_loc_13 = _loc_8.GetXML();
				if (_loc_13 != null)
				{
					_loc_14 = _loc_13.postfx;
					if (_loc_14 != null && _loc_14.length() > 0)
					{
						_loc_5.GetUberPostFX().ParseFromXML(_loc_14);
					}
				}
			}
			var _loc_9:* = s_mapAssetGroup.GetXML();
			for each (_loc_10 in _loc_9.vfx)
			{
				
				_loc_15 = _loc_10.@name;
				_loc_16 = RxAssetVFX.GetByName(_loc_15);
				_loc_16.SpawnChain(null, RxRenderer.GetInstance().GetFXManager(), null);
			}
			RxSequence.Parse("sequences.xml");
			_loc_11 = RxAssetCSV.GetByName(RxGameData_NameSpace.ITEM);
			RxItemPackageAsset.Initialize(s_view, _loc_11);
			RxUI.CreateHUD();
			RxJoin.SetLocalHeroCallback(OnLocalHero);
			RxJoin.CreateLocalHero();
			s_accumDualProfiler.End();
			RxUtilities.ForceGarbageCollection();
			
		}
		
		private static function OnLocalHero() : void
		{
			var _loc_3:RxItemPackageAsset = null;
			var _loc_4:RxItemPackageAsset = null;
			var _loc_1:* = RxAssetCSV.GetByName("spawner");
			var _loc_2:* = new RxAssetGroup();
			_loc_3 = new RxItemPackageAsset("arrow_projectile");
			_loc_4 = new RxItemPackageAsset("empty_projectile");
			_loc_2.AddAsset(_loc_3);
			_loc_2.AddAsset(_loc_4);
			s_accumDualProfiler.Start("items load");
			_loc_2.AddCallback(new RxAssetCallback(OnItemsLoaded));
			_loc_2.Load();
		}
		
		private static function OnItemsLoaded(_arg1:RxAssetCallback) : void
		{
			var _local2:XML;
			var _local3:RxAssetGroup;
			RxSimulation.EndLoading();
			s_accumDualProfiler.End();
			s_accumDualProfiler.End();
			RxUtilities.ForceGarbageCollection();
			s_accumDualProfiler.Snapshot("load complete");
			new RxGameScene(s_view, s_camera, s_stage, s_mapName);
			new RxNav(s_view);
			RxTransition.Parse("state.xml");
			if (!RxMain.IsAutomated())
			{
				RxSoundSuite.Parse();
			}
			
			if (RxClientVars.GetInt("layoutEditor") == 1)
			{
				new RxLayoutEditor(s_view, s_camera, s_stage, (("maps/" + s_mapName) + "/layout.xml"));
			}
			
			if (RxClientVars.GetString("debugRecord") == "record")
			{
				RxRecord.InitializeForRecord("valorRecord");
			}
			
			if (RxClientVars.GetString("debugRecord") == "play")
			{
				RxRecord.InitializeForPlayback("playback.xml");
			}
			
			s_questing = 1;
			RxUI.PostLoadAssets();
			RxSoundSuite.LoadAllSounds();
			
			if (!s_vfxLoaded)
			{
				_local2 = <assetGroup>
						<vfx url="vfx/abilityshockwavechain-vfx.xml"/>
						<vfx url="vfx/basic_arrow_streak_chain-vfx.xml"/>
						<vfx url="vfx/basicglowpulse-vfx.xml"/>
						<vfx url="vfx/barrel_smash-vfx.xml"/>
						<vfx url="vfx/blazing_sword-vfx.xml"/>
						<vfx url="vfx/bleeding_attack-vfx.xml"/>
						<vfx url="vfx/bleeding_dot-vfx.xml"/>
						<vfx url="vfx/burn_dot-vfx.xml"/>
						<vfx url="vfx/burn_weapon_status-vfx.xml"/>
						<vfx url="vfx/chargechain-vfx.xml"/>
						<vfx url="vfx/charge_hit-vfx.xml"/>
						<vfx url="vfx/chargedissipatechain-vfx.xml"/>
						<vfx url="vfx/click_to_move-vfx.xml"/>
						<vfx url="vfx/cleave_01-vfx.xml"/>
						<vfx url="vfx/cleave_02-vfx.xml"/>
						<vfx url="vfx/cleave_03-vfx.xml"/>
						<vfx url="vfx/cleave_04-vfx.xml"/>
						<vfx url="vfx/cleave_05-vfx.xml"/>
						<vfx url="vfx/cleave_06-vfx.xml"/>
						<vfx url="vfx/cleave_07-vfx.xml"/>
						<vfx url="vfx/cleave_08-vfx.xml"/>
						<vfx url="vfx/cleave_09-vfx.xml"/>
						<vfx url="vfx/cleave_10-vfx.xml"/>
						<vfx url="vfx/death_splatter-vfx.xml"/>
						<vfx url="vfx/death_splatter_crit-vfx.xml"/>
						<vfx url="vfx/fire_arrow_chain-vfx.xml"/>
						<vfx url="vfx/fire_impact_chain-vfx.xml"/>
						<vfx url="vfx/fxc_swordplant_cracks-vfx.xml"/>
						<vfx url="vfx/fxc_swordplant_ground_burst-vfx.xml"/>
						<vfx url="vfx/fxc_swordplant_shock_burst-vfx.xml"/>
						<vfx url="vfx/fxc_swordplant_shock_dust_ring-vfx.xml"/>
						<vfx url="vfx/fxc_swordplant_shock_dust-vfx.xml"/>
						<vfx url="vfx/fxc_swordplant_shock_streaks-vfx.xml"/>
						<vfx url="vfx/goldsprite-vfx.xml"/>
						<vfx url="vfx/hitfx-vfx.xml"/>
						<vfx url="vfx/ice_arrow-vfx.xml"/>
						<vfx url="vfx/icon_buff_cup-vfx.xml"/>
						<vfx url="vfx/icon_buff_fist-vfx.xml"/>
						<vfx url="vfx/icon_buff_shield-vfx.xml"/>
						<vfx url="vfx/itembgout-vfx.xml"/>
						<vfx url="vfx/itembgover-vfx.xml"/>
						<vfx url="vfx/itembg-vfx.xml"/>					
						<vfx url="vfx/itembg_artifact-vfx.xml"/>
						<vfx url="vfx/itembgout_artifact-vfx.xml"/>
						<vfx url="vfx/itembgover_artifact-vfx.xml"/>											
						<vfx url="vfx/itembg_epic-vfx.xml"/>
						<vfx url="vfx/itembgout_epic-vfx.xml"/>
						<vfx url="vfx/itembgover_epic-vfx.xml"/>
						<vfx url="vfx/itembg_good-vfx.xml"/>
						<vfx url="vfx/itembgout_good-vfx.xml"/>
						<vfx url="vfx/itembgover_good-vfx.xml"/>											
						<vfx url="vfx/itembg_legendary-vfx.xml"/>
						<vfx url="vfx/itembgout_legendary-vfx.xml"/>
						<vfx url="vfx/itembgover_legendary-vfx.xml"/>											
						<vfx url="vfx/itembg_normal-vfx.xml"/>
						<vfx url="vfx/itembgout_normal-vfx.xml"/>
						<vfx url="vfx/itembgover_normal-vfx.xml"/>											
						<vfx url="vfx/itembg_superior-vfx.xml"/>
						<vfx url="vfx/itembgout_superior-vfx.xml"/>
						<vfx url="vfx/itembgover_superior-vfx.xml"/>									
						<vfx url="vfx/itemspriteout-vfx.xml"/>
						<vfx url="vfx/itemspriteover-vfx.xml"/>
						<vfx url="vfx/itemsprite-vfx.xml"/>					
						<vfx url="vfx/leaf_shimmer-vfx.xml"/>
						<vfx url="vfx/level_up-vfx.xml"/>
						<vfx url="vfx/lighttest-vfx.xml"/>
						<vfx url="vfx/loot_coins-vfx.xml"/>
						<vfx url="vfx/loot_inventory_splash-vfx.xml"/>
						<vfx url="vfx/lootsparkleburst-vfx.xml"/>
						<vfx url="vfx/mortal_strike_attack-vfx.xml"/>
						<vfx url="vfx/mortal_strike_hit-vfx.xml"/>
						<vfx url="vfx/parry-vfx.xml"/>
						<vfx url="vfx/portal_back_arrow-vfx.xml"/>					
						<vfx url="vfx/questnpcpendingcompletion-vfx.xml"/>
						<vfx url="vfx/quest_check-vfx.xml"/>
						<vfx url="vfx/quest_dots-vfx.xml"/>
						<vfx url="vfx/quest_icon_hand-vfx.xml"/>
						<vfx url="vfx/quest_icon_skull-vfx.xml"/>
						<vfx url="vfx/quest_marker-vfx.xml"/>
						<vfx url="vfx/questnpcavailable-vfx.xml"/>
						<vfx url="vfx/questnpcinprogress-vfx.xml"/>
						<vfx url="vfx/rainofarrow_areahit-vfx.xml"/>
						<vfx url="vfx/shield_bash_cast-vfx.xml"/>
						<vfx url="vfx/shield_bash_hit-vfx.xml"/>
						<vfx url="vfx/shield_of_bravery_cast-vfx.xml"/>
						<vfx url="vfx/shield_of_bravery_status-vfx.xml"/>
						<vfx url="vfx/shield_spikes_cast-vfx.xml"/>
						<vfx url="vfx/shield_spikes_status-vfx.xml"/>
						<vfx url="vfx/shield_throw_hit-vfx.xml"/>
						<vfx url="vfx/shield_throw_streak-vfx.xml"/>
						<vfx url="vfx/shield_wall_cast-vfx.xml"/>
						<vfx url="vfx/stunned-vfx.xml"/>
						<vfx url="vfx/sweeping_strike-vfx.xml"/>
						<vfx url="vfx/sword_of_pride-vfx.xml"/>
						<vfx url="vfx/swordplant-vfx.xml"/>
						<vfx url="vfx/swordslice1to2-vfx.xml"/>
						<vfx url="vfx/swordslice1-vfx.xml"/>
						<vfx url="vfx/swordslice2to3a-vfx.xml"/>
						<vfx url="vfx/swordslice2to3b-vfx.xml"/>
						<vfx url="vfx/swordslice2-vfx.xml"/>
						<vfx url="vfx/swordslice3-vfx.xml"/>
						<vfx url="vfx/template.xml"/>
						<vfx url="vfx/test_numbers-vfx.xml"/>
						<vfx url="vfx/test-vfx.xml"/>
						<vfx url="vfx/whirlwindchain-vfx.xml"/>
						<vfx url="vfx/chicken_death-vfx.xml"/>
						<vfx url="vfx/quest_giver-vfx.xml"/>
						<vfx url="vfx/icon_buffcast_cup-vfx.xml"/>
						<vfx url="vfx/icon_buffcast_fist-vfx.xml"/>
						<vfx url="vfx/icon_buffcast_shield-vfx.xml"/>
					</assetGroup>;
				_local3 = new RxAssetGroup();
				_local3.Init(_local2, null);
				_local3.SetUsedByGPU(true);
				_local3.Load();
				s_vfxLoaded = true;
			}
			
			RxMusicManager.LoadAll();
			RxMusicManager.MapReady();
			RxMain.instance.SetGameState(RxMain.GAME_STATE_WAITING_FOR_LOADS);
			RxUtilities.ForceGarbageCollection();
		}
		
	}
}